package com.lambdademo.lambdatest;

import lombok.extern.slf4j.Slf4j;

import java.util.function.IntBinaryOperator;

@Slf4j
public class Fu {
    public static void main(String[] args) {
        int calculate = calculate((left, right) -> {
            int res = left * right + left;
            res += 2;
            return res;
        });
        log.info("calculate:{}",calculate);
    }
    public static int calculate(IntBinaryOperator operator) {
        int a = 1;
        int b = 2;
        return operator.applyAsInt(a, b);
    }
}
